import getFlowUnit from '@antelopecloud/utils/lib/unit/getFlowByUnit';

export const formatPercent = (used: number, total: number) => {
  const percent = Math.round((used / total) * 100);
  return percent;
};

export const transformStorage = (storage: number): number => {
  return Number(
    getFlowUnit(
      'PB',
      storage,
      {
        scale: 1024,
        showUnit: false,
        precision: 4,
      },
      false,
    ),
  );
};

export default '';
